<!--

    Copyright (C) 2015 The Gravitee team (http://gravitee.io)

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->
<div>
  <div class="gv-form-section" fxFlex="70">
    <div class="gv-form-section-title">
      <h5>Endpoints</h5>
      <mat-divider></mat-divider>
    </div>
    <div>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>Authorization endpoint</mat-label>
        <input matInput type="text" name="authorizeEndpoint" [value]="endpoint('/oauth/authorize')" disabled>
        <mat-hint>The authorization endpoint is used to obtain an OAuth 2.0 token using either authorization code or implicit grant type</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oauth/authorize')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>Token endpoint</mat-label>
        <input matInput type="text" name="tokenEndpoint" [value]="endpoint('/oauth/token')" disabled>
        <mat-hint>The token endpoint is used to obtain an OAuth 2.0 token</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oauth/token')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>Introspection endpoint</mat-label>
        <input matInput type="text" name="introspectEndpoint" [value]="endpoint('/oauth/introspect')" disabled>
        <mat-hint>The introspection endpoint allows to access information about an OAuth 2.0 token</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oauth/introspect')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>Revocation endpoint</mat-label>
        <input matInput type="text" name="revokeEndpoint" [value]="endpoint('/oauth/revoke')" disabled>
        <mat-hint> The revocation endpoint allows to invalidate a previously obtained OAuth 2.0 refresh or access token</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oauth/revoke')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>UserInfo endpoint</mat-label>
        <input matInput type="text" name="userInfoEndpoint" [value]="endpoint('/oidc/userinfo')" disabled>
        <mat-hint>The user info endpoint allows client applications to retrieve information about an authenticated user</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oidc/userinfo')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>End session endpoint</mat-label>
        <input matInput type="text" name="endSessionEndpoint" [value]="endpoint('/logout')" disabled>
        <mat-hint>The end session endpoint allows to invalidate a user's session</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/logout')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>OpenID Configuration endpoint</mat-label>
        <input matInput type="text" name="openIdConfigurationEndpoint" [value]="endpoint('/oidc/.well-known/openid-configuration')" disabled>
        <mat-hint>The OpenId configuration endpoint allows third party systems to get the complete OpenId configuration</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oidc/.well-known/openid-configuration')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>JWKs endpoint</mat-label>
        <input matInput type="text" name="jwksEndpoint" [value]="endpoint('/oidc/.well-known/jwks.json')" disabled>
        <mat-hint>Exposes the JWKs (JSON Web Keys) used to sign or encrypt JWTs issued by the authorization server</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/oidc/.well-known/jwks.json')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
      <mat-form-field appearance="outline" floatLabel="always">
        <mat-label>SCIM Configuration endpoint</mat-label>
        <input matInput type="text" name="scimConfigurationEndpoint" [value]="endpoint('/scim/ServiceProviderConfig')" disabled>
        <mat-hint>The SCIM configuration endpoint allows third party systems to get the complete SCIM configuration</mat-hint>
        <button mat-icon-button matSuffix matTooltip="Copy to clipboard" ngxClipboard [cbContent]="endpoint('/scim/ServiceProviderConfig')" (cbOnSuccess)="valueCopied('Copied to clipboard')" (click)="$event.preventDefault();"><mat-icon>content_copy</mat-icon></button>
      </mat-form-field>
    </div>
  </div>
  <div class="gv-page-description" fxFlex>
    <h3>Useful endpoints</h3>
    <div class="gv-page-description-content">
      <p>
        All necessary endpoints to communicate with the Authorization Server.
      </p>
    </div>
  </div>
</div>
